home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PsL Monthly 1993 December
/
PSL Monthly Shareware CD-ROM (December 1993).iso
/
prgmming
/
win
/
pascal
/
itsybit.exe
/
IBTEST.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1993-01-12
|
4KB
|
123 lines
program IBTest;
{
Program: IBTEST.PAS
Version: 1.0
Creation Date: January 12, 1993
Modification Date: January 12, 1993
Operating System: MS-DOS 3.x and Windows 3.1
Hardware Required: Windows-capable computer system
Programming System: Borland Pascal for Windows 7.0
Author: Craig Boyd
Ownership: Copyright (c) 1993 by Craig Boyd
About This Program
This program demonstrates how to use the ITSYBITS unit to create windows
with small horizontal or vertical captions. There are some limitations.
Windows with small captions cannot have menus (other than the system
menu) and they cannot have minimize or maximize buttons. Support for
minimize and maximize buttons has been left as an exercise for the
reader. See the comments in ITSYBITS.PAS for info on where to find
the original C version of ITSYBITS, which contains complete
documentation and comments from the orignal author.
The ITSYBITS unit declares a descendant of TWindow called
TIstyBitsWindow. Derive your windows from this type if you want them to
have small captions.
ItsyBits windows are ideal for use as tool palettes. They act like
normal windows, yet they are visually distinct from other windows.
Update History
update ver description (author)
------- --- -----------
9301.12 1.0 First release.
}
{$R-,S-,W-,X+}
uses
WinTypes,
WinProcs,
OWindows,
ItsyBits;
{$D Copyright (c) 1993 by Craig Boyd}
{-- Global Declarations -------------------------------------------------}
const
AppName : pchar = 'IBTest';
AppTitle : pchar = 'ItsyBits Test';
type
TTestApp = object(TApplication)
procedure InitMainWindow; virtual;
end;
PMainWindow = ^TMainWindow;
TMainWindow = object(TWindow)
Win1,
Win2 : PItsyBitsWindow;
constructor Init(aParent: PWindowsObject; aTitle: PChar);
end;
{-- TMainWindow Methods -------------------------------------------------}
constructor TMainWindow.Init;
begin
inherited Init(aParent,aTitle);
{
This has nothing to do with using TItsyBitsWindows, but just for
fun we're gonna center our main window on the screen.
}
with Attr do begin
W := (GetSystemMetrics(sm_CXScreen) div 10) * 8; { 80% of screen width }
H := (GetSystemMetrics(sm_CYScreen) div 10) * 6; { 60% of screen height }
X := (GetSystemMetrics(sm_CXScreen) - W) div 2;
Y := (GetSystemMetrics(sm_CYScreen) - H) div 2;
end;
{
Create a couple of TItsyBitsWindows.
}
Win1 := new(PItsyBitsWindow,Init(@Self,'Horz ItsyBits',ibs_HorzCaption));
Win2 := new(PItsyBitsWindow,Init(@Self,'Vert ItsyBits',ibs_VertCaption));
{
Let's size and position them, relative to the main window.
}
with Win1^.Attr do begin
X := 50 + Attr.X;
Y := 90 + Attr.Y;
W := 100;
H := 300;
end;
with Win2^.Attr do begin
X := 200 + Attr.X;
Y := 90 + Attr.Y;
W := 300;
H := 100;
end;
end { TMainWindow.Init };
{-- TTestApp Methods ----------------------------------------------------}
procedure TTestApp.InitMainWindow;
begin
MainWindow:= new(PMainWindow,Init(nil,AppTitle));
end { TTestApp.InitMainWindow };
{-- Main Program --------------------------------------------------------}
var
TestApp : TTestApp;
begin
TestApp.Init(AppName);
TestApp.Run;
TestApp.Done;
end.